<template>
    <view class="padding20-30" :style="{background: pageData.bgColor}">
        <view class="item bgwhite bor_radius_8 padding20 d-flex" v-for="(item,index) in list" :key="index"
            @click="toUrl('/pages/store/storeIndex?shop_id=' + item.shop_id)" :class="{'shadow': pageData.shadow, 'm-bot20': index != list.length - 1}">
            <image :src="$imgUrls(item.logo)" mode="aspectFill" class="img" :class="{'bor_radius': pageData.shape == 2}"></image>
            <view class="p-left20 flex-1 d-flex f-column j-sb">
                <view>
                    <view class="size34 bold300 ellipsis m-bot10">{{ item.name }}</view>
                    <view class="d-flex j-sb a-center">
                        <view class="d-flex a-center">
                            <view class="score bold p-right20" v-if="item.score && item.score != 0">
                                <text class="size28">{{ item.score }}</text>
                                <text class="size22">分</text>
                            </view>
                            <view class="size22 color_66 p-right20">销量{{ item.sales_number || 0 }}</view>
                            <!-- <view class="size22 color_66">{{ item.fPrice == 0 ? '免运费' : `运费￥${item.fPrice}` }}</view> -->
                            <view class="size22 color_66" v-if="item.favorable">好评{{ item.favorable }}%</view>
                        </view>
                        <view class="type h7 t-letter4" v-if="item.bussName">{{ item.bussName }}</view>
                    </view>
                </view>
                <view class="d-flex color_66" v-if="item.address">
                    <text class="iconfont icon-daohang m-right8"></text>
                    <text class="h6 ellipsis">{{ item.address }}</text>
                </view>
            </view>
        </view>
    </view>
</template>

<script>
export default {
    props: ['pageData'],
    data() {
        return {
            list:[]
        }
    },
    mounted() {
		this.getBlockInfo()
	},
    methods: {
        async getBlockInfo(){
            const result = await this.$getBlockInfo(this.pageData.list)
            this.list = result.list || []
        }
    }
}
</script>

<style lang="scss" scoped>
.item  {
    &.shadow {
        box-shadow: 0 4rpx 10rpx 2rpx rgba(105,105,105,0.1);
    }
    .img {
        width: 160rpx;
        height: 160rpx;
    }
    .score {
        color: #FF632D;
        line-height: 30rpx;
    }
    .type {
        width: fit-content;
        line-height: 30rpx;
        padding: 0 12rpx;     
        border: 1rpx solid #FF7510;
        border-radius: 2rpx;
        color: #FF7510;
    }
}
</style>